package com.ydy.data.controller;

import com.ydy.common.BaseController;
import com.ydy.common.model.SysLog;
import com.ydy.common.util.ParamsUtil;
import com.ydy.common.vo.PageInfo;
import com.ydy.data.service.LogInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
public class LogInfoController extends BaseController {

    @Autowired
    private LogInfoService logInfoService;

    /**
     * 查询操作日志
     * @Title: querySysLogInfo
     * @author: dy.yin 2021/4/2 10:06
     * @param: [request]
     * @return: java.lang.Object
     * @throws
     */
    @GetMapping("/querySysLogInfo")
    public Object querySysLogInfo(HttpServletRequest request){
        PageInfo pageInfo = ParamsUtil.getPageInfo(request);
        SysLog sysLog = ParamsUtil.getBeanParam(new SysLog(),request);

        List<SysLog> logList = logInfoService.querySysLogInfo(sysLog,pageInfo);
        pageInfo.setPageResult(logList);
        return pageInfo;
    }
}
